package com.ruoyi.lclook.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lclook.mapper.ProjectMessageMapper;
import com.ruoyi.lclook.domain.ProjectMessage;
import com.ruoyi.lclook.service.IProjectMessageService;

/**
 * 案例留言Service业务层处理
 * 
 * @author Choi
 * @date 2021-08-17
 */
@Service
public class ProjectMessageServiceImpl implements IProjectMessageService 
{
    @Autowired
    private ProjectMessageMapper projectMessageMapper;

    /**
     * 查询案例留言
     * 
     * @param id 案例留言ID
     * @return 案例留言
     */
    @Override
    public ProjectMessage selectProjectMessageById(Long id)
    {
        return projectMessageMapper.selectProjectMessageById(id);
    }

    /**
     * 查询案例留言列表
     * 
     * @param projectMessage 案例留言
     * @return 案例留言
     */
    @Override
    public List<ProjectMessage> selectProjectMessageList(ProjectMessage projectMessage)
    {
        return projectMessageMapper.selectProjectMessageList(projectMessage);
    }

    /**
     * 新增案例留言
     * 
     * @param projectMessage 案例留言
     * @return 结果
     */
    @Override
    public int insertProjectMessage(ProjectMessage projectMessage)
    {
        projectMessage.setCreateTime(DateUtils.getNowDate());
        return projectMessageMapper.insertProjectMessage(projectMessage);
    }

    /**
     * 修改案例留言
     * 
     * @param projectMessage 案例留言
     * @return 结果
     */
    @Override
    public int updateProjectMessage(ProjectMessage projectMessage)
    {
        projectMessage.setUpdateTime(DateUtils.getNowDate());
        return projectMessageMapper.updateProjectMessage(projectMessage);
    }

    /**
     * 批量删除案例留言
     * 
     * @param ids 需要删除的案例留言ID
     * @return 结果
     */
    @Override
    public int deleteProjectMessageByIds(Long[] ids)
    {
        return projectMessageMapper.deleteProjectMessageByIds(ids);
    }

    /**
     * 删除案例留言信息
     * 
     * @param id 案例留言ID
     * @return 结果
     */
    @Override
    public int deleteProjectMessageById(Long id)
    {
        return projectMessageMapper.deleteProjectMessageById(id);
    }
}
